const DEMO_DATA= [1,3,4,2,5,6,7,3,7,2,5,6,1];

/**
 * Array.from
 */

let handledArr = Array.from(DEMO_DATA,function (v) {
  return this.a+v
}, {a:5})

/**
 * hack codes:
  Array.from('ssssss')  ['s', 's', 's', 's', 's', 's'] 
  function combine(){
    let arr = [].concat.apply([], arguments);  //没有去重复的新数组
    return Array.from(new Set(arr));
  }
 */
// console.log(`静态方法 Array.from`, handledArr);

/**
 * Array.isArray
 */
function isArrayPolyfill( demo) {
  if(!Array.isArray) {
     return Object.prototype.toString.call(demo) === '[object Array]';
  }
}
console.log(
isArrayPolyfill([]),
isArrayPolyfill({}),
isArrayPolyfill(NaN),
isArrayPolyfill(true)
)
